package ly.jobdu;

import java.util.Scanner;

public class Q1163Prime {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			int num = scanner.nextInt();
			int flag = 0;
			String str = "";
			for (int i = 2; i < num; i++) {
				if (isPrime(i) && isUnitOne(i)) {
					str = str + " " + i;
					flag = 1;
				}
			}
			if (flag == 0) {
				System.out.println(-1);
			}
			if (flag == 1) {
				System.out.println(str.trim());
			}
		}
	}

	public static boolean isPrime(int num) {
		for (int i = 2; i < num; i++) {
			if (num % i == 0) {
				return false;
			}
		}
		return true;
	}

	public static boolean isUnitOne(int num) {
		if (num % 10 == 1) {
			return true;
		}
		return false;
	}
}
